import Vue from 'vue'
import Router from 'vue-router'
import store from "./store/store";

Vue.use(Router);

export default new Router({
    mode: 'hash',
    base: process.env.VUE_APP_API_HOST,
    routes: [
        {
            path: '/',
            redirect: '/index'
        },
        {
            path: '/index', // 首页
            name: 'index',
            meta: {
                requireAuth: true,
            },
            component: () => import('./views/index/Index.vue')
        },
        {
            path: '/login',
            name: 'login',
            component: () => import('./views/Login.vue'),
            meta: {
                requireAuth: false,
            }
        },
        {
            path: '/scenic/spot',  //超管景区列表
            name: 'scenicSpot',
            component: () => import('./views/jingQuManagement/admin/JingQuList.vue'),
            meta: {
                requireAuth: true,
            }
        },
        {
            path: '/scenic/spot/:id?',  //超管景点列表
            name: 'scenicSpotId',
            component: () => import('./views/jingQuManagement/admin/JingDianList.vue'),
            meta: {
                requireAuth: true,
            }
        },
        {
            path: '/equipment/list/:eq',  //超管景点列表=>设备管理
            name: 'equipmentId',
            component: () => import('./views/sheBeiManagement/singleEquip/singleEquipmentList.vue'),
            meta: {
                requireAuth: true,
            }
        },
        {
            path: '/feature/spot', // 景区管理员 景点列表
            name: 'featureSpot',
            component: () => import('./views/jingQuManagement/JingDianList.vue'),
            meta: {
                requireAuth: true,
            }
        },
        {
            path: '/account/list/qian', //  前台账号管理
            name: 'accountListQian',
            component: () => import('./views/zhangHaoManagement/accountListQian.vue'),
            meta: {
                requireAuth: true,
            }
        },
        {
            path: '/account/list/hou', //  后台账号管理
            name: 'accountListHou',
            component: () => import('./views/zhangHaoManagement/accountListHou.vue'),
            meta: {
                requireAuth: true,
            }
        },
        {
            path: '/equipment/list', //  设备管理-设备列表
            name: 'equipmentList',
            component: () => import('./views/sheBeiManagement/equipmentList.vue'),
            meta: {
                requireAuth: true,
            }
        },
        {
            path: '/equipmentfen/list', //  设备管理-设备分类列表
            name: 'equipmentFenList',
            component: () => import('./views/sheBeiManagement/equipmentFen.vue'),
            meta: {
                requireAuth: true,
            }
        },
        {
            path: '/equipmentfenchildren/list/:id', //  设备管理-设备子分类列表
            name: 'equipmentFenChildrenList',
            component: () => import('./views/sheBeiManagement/equipmentFenChildren.vue'),
            meta: {
                requireAuth: true,
            }
        },
        {
            path: '/crowd/analysis', //  人群分析
            name: 'crowdAnalysis',
            component: () => import('./views/renQunFenXi/CrowdAnalysis.vue'),
            meta: {
                requireAuth: true,
            }
        },
        {
            path: '/data/display', //  数据展示
            name: 'dataDisplay',
            component: () => import('./views/shuJuZhanShi/DataDisplay.vue'),
            meta: {
                requireAuth: true,
            }
        }
        ,
        {
            path: '/upload/pdf', //  上传pdf
            name: 'uploadPdf',
            component: () => import('./views/uploadPDF/upload.vue'),
            meta: {
                requireAuth: true,
            }
        }
    ]
})
